package com.consumer.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author Liunh
 */
@Data
@Component
public class AppProperties {

    @Value("${logging.file.path}")
    private String logPath;
    @Value(value = "${spring.application.name:library-service}")
    private String appName;
    @Value(value = "${server.node}")
    private String appNode;
    @Value(value = "${server.port:8021}")
    private Integer port;
    @Value(value = "${server.servlet.context-path:/}")
    private String contextPath;

    @Value(value = "${app.file.uri:/usr/local/app/uploadFile}")
    private String fileUri;
    @Value(value = "${app.cache.menu.enable:false}")
    private boolean menuCacheEnable;
    @Value(value = "${app.cluster.isCluster:false}")
    private Boolean isCluster;
    @Value(value = "${app.cluster.hosts:127.0.0.1:8080}")
    private String hosts;
    @Value(value = "${app.cluster.password:gISXjXRZD7pWdljJIFqXUQ==}")
    private String clusterPassword;
    @Value(value = "${app.cluster.secretKey:Asd@123456!}")
    private String clusterSecretKey;

    @Value(value = "${app.logHoldDay:365}")
    private Integer logHoldDay;

    @Value(value = "${app.user.encryptedTransmissionEnable:false}")
    private Boolean encryptedTransmissionEnable;
    @Value(value = "${app.user.secretKey:fgD1A6z15DmlHB8Z}")
    private String userSecretKey;
    @Value(value = "${app.user.updatePwdIntervalDay:90}")
    private Integer updatePwdIntervalDay;

    // --------------------------- 数据库配置 ----------------------------

    @Value(value = "${spring.session.jdbc.platform:DM}")
    private String dbPlatform;
    @Value(value = "${spring.jpa.properties.hibernate.default_schema:SYSDBA}")
    private String dbSchema;

    @Value("${spring.datasource.type:com.zaxxer.hikari.HikariDataSource}")
    public String type;
    @Value("${spring.datasource.driverClassName}")
    public String driver;
    @Value("${spring.datasource.url}")
    public String url;
    @Value("${spring.datasource.username:test}")
    public String username;
    @Value("${spring.datasource.password:123456}")
    public String password;

    @Value(value = "${rocketmq.client.logUseSlf4j:true}")
    private String logUseSlf4j;
    @Value(value = "${rocketmq.client.logUseSlf4j:/user/home/logs}")
    private String logRoot;
    @Value(value = "${rocketmq.client.logLevel:INFO}")
    private String logLevel;
    @Value(value = "${rocketmq.client.logFileMaxIndex:10}")
    private Integer logFileMaxIndex;
    @Value(value = "${rocketmq.client.log.loadconfig:true}")
    private String loadconfig;
    @Value(value = "${rocketmq.client.log.configFile:/user/home/logs/rocketmq_client.log}")
    private String configFile;

    @Value(value = "${app.statistics.enabled:false}")
    private boolean statisticsEnabled;
    @Value(value = "${app.statistics.url}")
    private String statisticsAppUrl;

}
